<script>
import AsideController from "@/components/AsideController.vue";
import HeaderController from "@/components/HeaderController.vue";


export default {
  name:"IndexPage",
  components: {HeaderController, AsideController},
  data(){
    return {
      isCollapse:false,
      aside_width:'200px',
      icon:'el-icon-s-fold'
    }
  },
  methods:{
    DoCollapse(){
      console.log(1111)
      this.isCollapse = !this.isCollapse
      if(!this.isCollapse){//展开
        this.aside_width='200px'
        this.icon='el-icon-s-fold'
      }else {//收起
        this.aside_width='64px'
        this.icon='el-icon-s-unfold'

      }
    }
  }
};
</script>

<template>
  <el-container style="height: 100%; border: 1px solid #eee">
    <el-aside :width="aside_width" style="height: 100vh ;background-color: rgb(238, 241, 246); margin-left: -1px">
      <AsideController :isCollapse="isCollapse"></AsideController>
    </el-aside>

    <el-container style="height: 100%;">
      <el-header style="text-align: right; font-size: 12px; height: 100%; border-bottom: antiquewhite 1px solid;">
        <HeaderController @DoCollapse="DoCollapse" :icon="icon"></HeaderController>
      </el-header>
      <el-main style="height: 100%;">
        <router-view></router-view>
      </el-main>
    </el-container>
  </el-container>
</template>

<style scoped>
.el-header {
  background-color: #eeeeee;
  color: #333;
  line-height: 60px;
}
  .el-main{
    padding: 5px;
  }
.el-aside {
  color: #333;
}
</style>